package architect.design.patterns.creation.abstractfactory;

/**
 * 抽象工厂模式
 *
 * @author guanxin
 * @date 2018/5/4 14:47
 */

public class AbstractFactoryCase {

    public static void main(String[] args) {
        // 华为生产
        IElectronicFactory electronicFactory = new HuaweiElectronicFactory();
        IPhone phone = electronicFactory.createPhone();
        phone.call();

        // 苹果生产
        electronicFactory = new AppleElectronicFactory();
        IPad pad = electronicFactory.createPad();
        pad.watch();
    }
}
